{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Q1 - WAP for taking one number a input and then using if elif else concept, assign a grade to the input number from \n",
    "\n",
    "#A,B,C,D,E, Fail\n",
    "\n",
    "#In a formatted report card\n",
    "\n",
    "#|------|\n",
    "#|   A |\n",
    "#|_____|\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enter your marks - 78\n",
      "|--------|\n",
      "|   B    |\n",
      "|--------|\n"
     ]
    }
   ],
   "source": [
    "#Assignment 1 - \n",
    "\n",
    "marks = int(input(\"Enter your marks - \"))\n",
    "\n",
    "print('|--------|')\n",
    "if(marks >= 85):\n",
    "    print(\"|   A    |\")\n",
    "elif (marks>=75 and marks <= 84):\n",
    "    print(\"|   B    |\")\n",
    "elif (marks>=65 and marks <= 74):\n",
    "    print(\"|   C    |\")\n",
    "elif (marks>=55 and marks <= 64):\n",
    "    print(\"|   D    |\")\n",
    "elif (marks>=45 and marks <= 54):\n",
    "    print(\"|   E    |\")\n",
    "else:\n",
    "    print(\"Need imporvement\")\n",
    "    \n",
    "print('|--------|')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Computer Generated Team India Cricket Score -  58\n",
      "enter your guess 55\n",
      "Close by, you are True Indian Fan!\n"
     ]
    }
   ],
   "source": [
    "# Assignment 2 - \n",
    "\n",
    "#Generating computer Score module \n",
    "\n",
    "from random import randint \n",
    "\n",
    "computer_generated_team_india_score = randint(1,250)\n",
    "print(\"Computer Generated Team India Cricket Score - \",computer_generated_team_india_score)\n",
    "\n",
    "#Guessing module --- \n",
    "while True:\n",
    "    user_input = int(input(\"enter your guess \"))\n",
    "    if(user_input>=1 and user_input<=250):\n",
    "        break\n",
    "    else:\n",
    "        print(\"Reduce your expectation for 20-20 Cricket. Enter your number again\")\n",
    "\n",
    "#Checking whether the number is near by yes or no \n",
    "diffeence = abs(user_input - computer_generated_team_india_score)\n",
    "\n",
    "if ( diffeence <=10 and diffeence >=1):\n",
    "    print(\"Close by, you are True Indian Fan!\")\n",
    "else:\n",
    "    print(\"You don't watch that much! :P\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Assignment 3 - \n",
    "\n",
    "\n",
    "file = open(\"assignment5.txt\",'w')\n",
    "\n",
    "file.write(\"I love and live for FCS\")\n",
    "\n",
    "file.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I love and live for FCS\n"
     ]
    }
   ],
   "source": [
    "file = open(\"assignment5.txt\",'r')\n",
    "\n",
    "print(file.read())\n",
    "\n",
    "file.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enter number of chances you want a user to upload ?2\n",
      "Enter the min Length ?10\n",
      "Enter ur Height of photo ?0\n",
      "Enter ur Width of the photo ?0\n",
      "minimum photo size should be four -  10\n",
      "Enter ur Height of photo ?10\n",
      "Enter ur Width of the photo ?20\n",
      "Crop it\n"
     ]
    }
   ],
   "source": [
    "# Assignment 4 -- \n",
    "\n",
    "# L, N, W, H\n",
    "# how many times u want to upload a Photo ? \n",
    "n = int(input(\"Enter number of chances you want a user to upload ?\"))\n",
    "\n",
    "#Enter the Lenght size \n",
    "l = int(input(\"Enter the min Length ?\"))\n",
    "\n",
    "curent_operation = 0\n",
    "while(curent_operation<n):\n",
    "    curent_operation += 1\n",
    "    \n",
    "    h = int(input(\"Enter ur Height of photo ?\"))\n",
    "    w = int(input(\"Enter ur Width of the photo ?\"))\n",
    "    \n",
    "    if ( h >= l and w >=l):\n",
    "        if(h==w):\n",
    "            print(\"Accepted\")\n",
    "        else:\n",
    "            print(\"Crop it\")\n",
    "    else:\n",
    "        print(\"minimum photo size should be - \", l )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Assignment 5\n",
    "\n",
    "ankit_x = 0 \n",
    "ankit_y = 0 \n",
    "\n",
    "max_move = 0\n",
    "\n",
    "while(max_move <= 5):\n",
    "    max_move += 1\n",
    "    command = input(\"Enter the Command for ankit to move - \")\n",
    "    command = command.lower()\n",
    "    \n",
    "    if(command == \"l\"):\n",
    "        ankit_x += -1\n",
    "    elif (command == \"r\"):\n",
    "        ankit_x += +1\n",
    "    elif (command == \"u\"):\n",
    "        ankit_y += 1\n",
    "    elif( command == \"d\"):\n",
    "        ankit_y -= 1\n",
    "    else: \n",
    "        print(\"Enter valid input, L,R,U,D\")\n",
    "    \n",
    "    print(\"ankit is here - \", ankit_x, ankit_y)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
